package exp3;

import java.util.Random;

public class Exp3_3 {
	public static void main(String[] args) {
		int i = 0,total=100000000,in=0;
		double px,py,PI;
		Random r = new Random();
		while(i++<total) {
			px=r.nextFloat();
			py=r.nextFloat();
			if(px*px+py*py<=1)
				in++;
		}
		PI=4.0*in/total;
		System.out.println(PI);
	}
}
